INCLUDES:=./  ./include ../include ../utils
SRCS:=$(wildcard *.cc) 
LIBS:=  -lwfrest -lworkflow -lssl -lcrypto -lcrypt
OBJS:=$(patsubst %.cc, %.o, $(SRCS))
SERVER:= CloudiskServer

# 目标 : 依赖
$(SERVER): main.o CloudiskServer.o Token.o Hash.o ../src/RecommendedCandidateWords/keyRecommander.o ../src/WebSearch/SplitToolCppJieba.o ../src/RecommendedCandidateWords/Dictionary.o ../utils/Utils.o ../src/WebSearch/WebPageQuery.o
	g++ $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

%.o:%.cc
	g++ -c $^ -o $@  $(addprefix -I, $(INCLUDES)) -g
../src/RecommendedCandidateWords/keyRecommander.o:../src/RecommendedCandidateWords/keyRecommander.cpp
	g++ -c ../src/RecommendedCandidateWords/keyRecommander.cpp -o ../src/RecommendedCandidateWords/keyRecommander.o -g -I ../include/ -I ../utils/
../src/RecommendedCandidateWords/Dictionary.o:../src/RecommendedCandidateWords/Dictionary.cpp
	g++ -c ../src/RecommendedCandidateWords/Dictionary.cpp  -o ../src/RecommendedCandidateWords/Dictionary.o -g -I ../include/ -I ../utils/
../utils/Utils.o:../utils/Utils.cpp
	g++ -c ../utils/Utils.cpp -o ../utils/Utils.o -g
../src/WebSearch/WebPageQuery.o:../src/WebSearch/WebPageQuery.cpp
	g++ -c ../src/WebSearch/WebPageQuery.cpp -o ../src/WebSearch/WebPageQuery.o -I ../include -I ../utils/
../src/WebSearch/SplitToolCppJieba.o:../src/WebSearch/SplitToolCppJieba.cpp
	g++ -c ../src/WebSearch/SplitToolCppJieba.cpp -o ../src/WebSearch/SplitToolCppJieba.o -g -I ../include -I ../utils/
# ../utils/Utils.o:../utils/Utils.cpp
# 	g++ -c ../utils/Utils.cpp -o ../utils/Utils.o -g
# ../src/Dictionary.o:../src/Dictionary.cpp
# 	g++ -c ../src/Dictionary.cpp ../utils/Utils.cpp -o ../src/Dictionary.o -I ../include/ -I ../utils/
# ../src/keyRecommander.o:../src/keyRecommander.cpp
# 	g++ -c ../src/keyRecommander.cpp ../src/Dictionary.cpp ../utils/Utils.cpp -o ../src/keyRecommander.o -g -I ../include -I ../utils


HASH:=testHash
TOKEN:=testToken

$(HASH): Hash.o testHash.o
	g++ $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

$(TOKEN): Token.o testToken.o
	g++ $^ -o $@ $(LIBS) $(addprefix -I, $(INCLUDES)) -g

echo:
	echo $(INCLUDES)
	echo $(SRCS)

clean:
	rm -rf $(OBJS) $(SERVER) $(HASH) $(TOKEN)
